package com.haizhi.crm.api.controller.concerngroup;

import com.haizhi.crm.biz.model.ConcernedGroupQo;
import com.haizhi.crm.biz.service.ConcernedGroupService;
import com.haizhi.crm.common.model.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * Created by yangyijun on 2018/6/24.
 */
@Api(description = "[业务-用户关注分组]" )
@RestController
@RequestMapping("" )
public class ConcernedGroupController {

    @Autowired
    private ConcernedGroupService concernedGroupService;

    @ApiOperation(value = "保存关注分组" )
    @PostMapping("/save" )
    public Response save(@RequestBody @Valid ConcernedGroupQo groupQo) {
        return concernedGroupService.save(groupQo);
    }

    @ApiOperation(value = "查询用户已创建的关注分组列表" )
    @GetMapping("/list" )
    public Response list() {
        return concernedGroupService.list();
    }
}
